<template>
  <div class="box">
  	<ul class="foodlist">
  		<li class="foodbox" v-for="food in foods">
  			<router-link class="items" to="/food">
	  		  <img :src="food.tpuri" class="food_img" />
	  		</router-link>
  		  <div class="foodtit">
  		  	<h4 class="food_name">{{food.cpmc}}</h4>
  		  	<em class="food_rmb">￥{{food.cpjg}}</em>
  		  	
  		  		<div class="food_add" @click="addcart"><i class="iconfont icon-jia"></i></div>
  		  		
  		  </div>  		  
  		</li>
  	</ul>
  </div>
</template>

<script >

export default { 
	props: ['foods'],
  data () {
    return {
     
    }    
  },
  methods:{   
	    addcart: function (){ 	    	
			localStorage["cartfood"]=this.foods.foodname;
			console.log(localStorage["cartfood"]);
	    }
	}
}
</script>


<style scoped src="../assets/css/foodlist.css"></style>
